﻿@model MStack.Infrastructure.Entities.Topic

@{
    ViewBag.Title = "编辑帖子";
}
<div class="page-header">
    <h1>编辑帖子 <small></small></h1>
</div>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.Replies)
        @Html.HiddenFor(model => model.Views)
        <div class="form-group">
            @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Category, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <select class="form-control" id="Category" name="Category">
                    <option value="0">DoNet</option>
                    <option value="1">UI</option>
                    <option value="2">Other</option>
                </select>
                @Html.ValidationMessageFor(model => model.Category, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Content, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Content, new { @class = "form-control", rows = "5" })
                @Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PublishDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PublishDateTime, new { htmlAttributes = new { @class = "form-control",@readonly="readonly" } })
                @Html.ValidationMessageFor(model => model.PublishDateTime, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="发表帖子" class="btn btn-primary" />
            </div>
        </div>
    </div>
}

<div class="row">
    <div class="pull-right">
        @Html.ActionLink("返回列表", "Index", "", new { @class = "btn btn-default" })
    </div>
</div>